using Google.ProtocolBuffers;
using micromsg.Proto;
using System;
using System.CodeDom.Compiler;
using System.Diagnostics;
using System.IO;
using System.Runtime.CompilerServices;
namespace micromsg
{
	[GeneratedCode("ProtoGen", "2.3.0.277"), DebuggerNonUserCode, CompilerGenerated]
	public sealed class ModUserImg : GeneratedMessageLite<ModUserImg, ModUserImg.Builder>
	{
		[GeneratedCode("ProtoGen", "2.3.0.277"), DebuggerNonUserCode, CompilerGenerated]
		public sealed class Builder : GeneratedBuilderLite<ModUserImg, ModUserImg.Builder>
		{
			private bool resultIsReadOnly;
			private ModUserImg result;
			protected override ModUserImg.Builder ThisBuilder
			{
				get
				{
					return this;
				}
			}
			public override bool IsInitialized
			{
				get
				{
					return this.result.IsInitialized;
				}
			}
			protected override ModUserImg MessageBeingBuilt
			{
				get
				{
					return this.PrepareBuilder();
				}
			}
			public override ModUserImg DefaultInstanceForType
			{
				get
				{
					return ModUserImg.DefaultInstance;
				}
			}
			public uint ImgType
			{
				get
				{
					return this.result.ImgType;
				}
				set
				{
					this.SetImgType(value);
				}
			}
			public uint ImgLen
			{
				get
				{
					return this.result.ImgLen;
				}
				set
				{
					this.SetImgLen(value);
				}
			}
			public ByteString ImgBuf
			{
				get
				{
					return this.result.ImgBuf;
				}
				set
				{
					this.SetImgBuf(value);
				}
			}
			public string ImgMd5
			{
				get
				{
					return this.result.ImgMd5;
				}
				set
				{
					this.SetImgMd5(value);
				}
			}
			public Builder()
			{
				this.result = ModUserImg.DefaultInstance;
				this.resultIsReadOnly = true;
			}
			internal Builder(ModUserImg cloneFrom)
			{
				this.result = cloneFrom;
				this.resultIsReadOnly = true;
			}
			private ModUserImg PrepareBuilder()
			{
				if (this.resultIsReadOnly)
				{
					ModUserImg other = this.result;
					this.result = new ModUserImg();
					this.resultIsReadOnly = false;
					this.MergeFrom(other);
				}
				return this.result;
			}
			public override ModUserImg.Builder Clear()
			{
				this.result = ModUserImg.DefaultInstance;
				this.resultIsReadOnly = true;
				return this;
			}
			public override ModUserImg.Builder Clone()
			{
				if (this.resultIsReadOnly)
				{
					return new ModUserImg.Builder(this.result);
				}
				return new ModUserImg.Builder().MergeFrom(this.result);
			}
			public override ModUserImg BuildPartial()
			{
				if (this.resultIsReadOnly)
				{
					return this.result;
				}
				this.resultIsReadOnly = true;
				return this.result.MakeReadOnly();
			}
			public override ModUserImg.Builder MergeFrom(IMessageLite other)
			{
				if (other is ModUserImg)
				{
					return this.MergeFrom((ModUserImg)other);
				}
				base.MergeFrom(other);
				return this;
			}
			public override ModUserImg.Builder MergeFrom(ModUserImg other)
			{
				return this;
			}
			public override ModUserImg.Builder MergeFrom(ICodedInputStream input)
			{
				return this.MergeFrom(input, ExtensionRegistry.Empty);
			}
			public override ModUserImg.Builder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry)
			{
				this.PrepareBuilder();
				uint num;
				string text;
				while (input.ReadTag(out num, out text))
				{
					if (num == 0u && text != null)
					{
						int num2 = Array.BinarySearch<string>(ModUserImg._modUserImgFieldNames, text, StringComparer.get_Ordinal());
						if (num2 < 0)
						{
							this.ParseUnknownField(input, extensionRegistry, num, text);
							continue;
						}
						num = ModUserImg._modUserImgFieldTags[num2];
					}
					uint num3 = num;
					if (num3 <= 8u)
					{
						if (num3 == 0u)
						{
							throw InvalidProtocolBufferException.InvalidTag();
						}
						if (num3 == 8u)
						{
							this.result.hasImgType = input.ReadUInt32(ref this.result.imgType_);
							continue;
						}
					}
					else
					{
						if (num3 == 16u)
						{
							this.result.hasImgLen = input.ReadUInt32(ref this.result.imgLen_);
							continue;
						}
						if (num3 == 26u)
						{
							this.result.hasImgBuf = input.ReadBytes(ref this.result.imgBuf_);
							continue;
						}
						if (num3 == 34u)
						{
							this.result.hasImgMd5 = input.ReadString(ref this.result.imgMd5_);
							continue;
						}
					}
					if (WireFormat.IsEndGroupTag(num))
					{
						return this;
					}
					this.ParseUnknownField(input, extensionRegistry, num, text);
				}
				return this;
			}
			public ModUserImg.Builder SetImgType(uint value)
			{
				this.PrepareBuilder();
				this.result.hasImgType = true;
				this.result.imgType_ = value;
				return this;
			}
			public ModUserImg.Builder ClearImgType()
			{
				this.PrepareBuilder();
				this.result.hasImgType = false;
				this.result.imgType_ = 0u;
				return this;
			}
			public ModUserImg.Builder SetImgLen(uint value)
			{
				this.PrepareBuilder();
				this.result.hasImgLen = true;
				this.result.imgLen_ = value;
				return this;
			}
			public ModUserImg.Builder ClearImgLen()
			{
				this.PrepareBuilder();
				this.result.hasImgLen = false;
				this.result.imgLen_ = 0u;
				return this;
			}
			public ModUserImg.Builder SetImgBuf(ByteString value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				this.result.hasImgBuf = true;
				this.result.imgBuf_ = value;
				return this;
			}
			public ModUserImg.Builder ClearImgBuf()
			{
				this.PrepareBuilder();
				this.result.hasImgBuf = false;
				this.result.imgBuf_ = ByteString.Empty;
				return this;
			}
			public ModUserImg.Builder SetImgMd5(string value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				this.result.hasImgMd5 = true;
				this.result.imgMd5_ = value;
				return this;
			}
			public ModUserImg.Builder ClearImgMd5()
			{
				this.PrepareBuilder();
				this.result.hasImgMd5 = false;
				this.result.imgMd5_ = "";
				return this;
			}
		}
		public const int ImgTypeFieldNumber = 1;
		public const int ImgLenFieldNumber = 2;
		public const int ImgBufFieldNumber = 3;
		public const int ImgMd5FieldNumber = 4;
		private static readonly ModUserImg defaultInstance;
		private static readonly string[] _modUserImgFieldNames;
		private static readonly uint[] _modUserImgFieldTags;
		private bool hasImgType;
		private uint imgType_;
		private bool hasImgLen;
		private uint imgLen_;
		private bool hasImgBuf;
		private ByteString imgBuf_ = ByteString.Empty;
		private bool hasImgMd5;
		private string imgMd5_ = "";
		private int memoizedSerializedSize = -1;
		public static ModUserImg DefaultInstance
		{
			get
			{
				return ModUserImg.defaultInstance;
			}
		}
		public override ModUserImg DefaultInstanceForType
		{
			get
			{
				return ModUserImg.DefaultInstance;
			}
		}
		protected override ModUserImg ThisMessage
		{
			get
			{
				return this;
			}
		}
		public uint ImgType
		{
			get
			{
				return this.imgType_;
			}
		}
		public uint ImgLen
		{
			get
			{
				return this.imgLen_;
			}
		}
		public ByteString ImgBuf
		{
			get
			{
				return this.imgBuf_;
			}
		}
		public string ImgMd5
		{
			get
			{
				return this.imgMd5_;
			}
		}
		public override bool IsInitialized
		{
			get
			{
				return this.hasImgType && this.hasImgLen;
			}
		}
		public override int SerializedSize
		{
			get
			{
				int num = this.memoizedSerializedSize;
				if (num != -1)
				{
					return num;
				}
				num = 0;
				if (this.hasImgType)
				{
					num += CodedOutputStream.ComputeUInt32Size(1, this.ImgType);
				}
				if (this.hasImgLen)
				{
					num += CodedOutputStream.ComputeUInt32Size(2, this.ImgLen);
				}
				if (this.hasImgBuf)
				{
					num += CodedOutputStream.ComputeBytesSize(3, this.ImgBuf);
				}
				if (this.hasImgMd5)
				{
					num += CodedOutputStream.ComputeStringSize(4, this.ImgMd5);
				}
				this.memoizedSerializedSize = num;
				return num;
			}
		}
		private ModUserImg()
		{
		}
		public override void WriteTo(ICodedOutputStream output)
		{
			int arg_06_0 = this.SerializedSize;
			string[] modUserImgFieldNames = ModUserImg._modUserImgFieldNames;
			if (this.hasImgType)
			{
				output.WriteUInt32(1, modUserImgFieldNames[3], this.ImgType);
			}
			if (this.hasImgLen)
			{
				output.WriteUInt32(2, modUserImgFieldNames[1], this.ImgLen);
			}
			if (this.hasImgBuf)
			{
				output.WriteBytes(3, modUserImgFieldNames[0], this.ImgBuf);
			}
			if (this.hasImgMd5)
			{
				output.WriteString(4, modUserImgFieldNames[2], this.ImgMd5);
			}
		}
		public override int GetHashCode()
		{
			int num = base.GetType().GetHashCode();
			if (this.hasImgType)
			{
				num ^= this.imgType_.GetHashCode();
			}
			if (this.hasImgLen)
			{
				num ^= this.imgLen_.GetHashCode();
			}
			if (this.hasImgBuf)
			{
				num ^= this.imgBuf_.GetHashCode();
			}
			if (this.hasImgMd5)
			{
				num ^= this.imgMd5_.GetHashCode();
			}
			return num;
		}
		public override bool Equals(object object_0)
		{
			ModUserImg modUserImg = object_0 as ModUserImg;
			return modUserImg != null && (this.hasImgType == modUserImg.hasImgType && (!this.hasImgType || this.imgType_.Equals(modUserImg.imgType_))) && (this.hasImgLen == modUserImg.hasImgLen && (!this.hasImgLen || this.imgLen_.Equals(modUserImg.imgLen_))) && (this.hasImgBuf == modUserImg.hasImgBuf && (!this.hasImgBuf || this.imgBuf_.Equals(modUserImg.imgBuf_))) && (this.hasImgMd5 == modUserImg.hasImgMd5 && (!this.hasImgMd5 || this.imgMd5_.Equals(modUserImg.imgMd5_)));
		}
		public override void PrintTo(TextWriter writer)
		{
			GeneratedMessageLite<ModUserImg, ModUserImg.Builder>.PrintField("ImgType", this.hasImgType, this.imgType_, writer);
			GeneratedMessageLite<ModUserImg, ModUserImg.Builder>.PrintField("ImgLen", this.hasImgLen, this.imgLen_, writer);
			GeneratedMessageLite<ModUserImg, ModUserImg.Builder>.PrintField("ImgBuf", this.hasImgBuf, this.imgBuf_, writer);
			GeneratedMessageLite<ModUserImg, ModUserImg.Builder>.PrintField("ImgMd5", this.hasImgMd5, this.imgMd5_, writer);
		}
		public static ModUserImg ParseFrom(byte[] data)
		{
			return ModUserImg.CreateBuilder().MergeFrom(data).BuildParsed();
		}
		private ModUserImg MakeReadOnly()
		{
			return this;
		}
		public static ModUserImg.Builder CreateBuilder()
		{
			return new ModUserImg.Builder();
		}
		public override ModUserImg.Builder ToBuilder()
		{
			return ModUserImg.CreateBuilder(this);
		}
		public override ModUserImg.Builder CreateBuilderForType()
		{
			return new ModUserImg.Builder();
		}
		public static ModUserImg.Builder CreateBuilder(ModUserImg prototype)
		{
			return new ModUserImg.Builder(prototype);
		}
		static ModUserImg()
		{
			ModUserImg.defaultInstance = new ModUserImg().MakeReadOnly();
			ModUserImg._modUserImgFieldNames = new string[]
			{
				"ImgBuf",
				"ImgLen",
				"ImgMd5",
				"ImgType"
			};
			ModUserImg._modUserImgFieldTags = new uint[]
			{
				26u,
				16u,
				34u,
				8u
			};
			object.ReferenceEquals(micromsg.Proto.ModUserImg.Descriptor, null);
		}
	}
}
